package com.ychen.nttey.chat;

import io.netty.bootstrap.Bootstrap;
import io.netty.channel.*;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;

import java.util.Scanner;

/**
 * @Author chenyuliao
 * @Date 2020/5/15 21:41
 */
public class ChatClient {

    public static void main(String[] args) throws InterruptedException {
        NettyClient nettyClient = new NettyClient();
        nettyClient.start();
        String inetHost = "127.0.0.1";
        int inetPort = 7000;
        nettyClient.sendMessage(inetHost, inetPort, "我要黑掉你的服务器，嘿嘿~~~");

//        for (int i = 0; i < 1000; i++) {
//            nettyClient.sendMessage(inetHost, inetPort, "我要黑掉你的服务器，嘿嘿~~~,第 " + i + " 次请求");
//        }


    }

}
